package vn.orderonline.com.core.business.member;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.orderonline.core.dao.ResideDao;
import vn.orderonline.core.dao.entity.Reside;

@Service
@Transactional
public class ResideImpl implements IReside {
	
	@Autowired
	private ResideDao resideDao;
	
	public Map<String, String> getAllReside() {
		List<Reside> list = resideDao.findAll();
		Map<String, String> map = new LinkedHashMap<>();
		if (!list.isEmpty()) {
			for (Reside re : list) {
				map.put(re.getResideId().toString(), re.getResideName());
			}
		}
		return map;
	}

}
